package myTest;
import java.io.BufferedReader;
import java.io.FileReader;

public class readTxt {
	public static void main(String[] args){
		try{
			String str;
			BufferedReader in = new BufferedReader(new FileReader("C:\\Users\\ChengXin\\Desktop\\out.txt"));
			str = in.readLine();
			String array[] = str.split(" ");
			for (int i=0; i<array.length; i++)
				if(array[i].matches("123"))
					System.out.println(array[i]);
			
			while((str=in.readLine())!=null)
				System.out.println(str);
		}
		catch(Exception e){
			System.out.print(e.toString());
		}
		
	}
}